﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Licenta1;
using Licenta1.Expressions;

namespace Licenta1.Statements
{
    class DimensionStatement : Statement
    {

        string type;
        Statement program;

        public DimensionStatement(Context con, string t, Statement s)
            : base(con)
        {
            type = t;
            program = s;
        }

        public override void Execute()
        {
            if (type == "3D" || type == "3d")
            {
                context.mp.rt = new RayTracer.RayTracer(context.mp.W, context.mp.H);
                context.mp.btok = true;
            }
            else context.mp.btok = false;
            
            program.Execute();
        }
    }
}